home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
DO1002.ARJ
/
ASK.SCR
next >
Wrap
Text File
|
1991-12-27
|
2KB
|
53 lines
.pg clr
»cy«COMMAND NAME»gy«: »%t« AnswerQuestion »ye«
/ASK {variable} {Default} {Prompt} {maxlength} UC
/CW
Calls »%t«GetString»#« using »cy«{variable}»#«, »cy«{default}»#«, »cy«{Prompt}»#«,
»cy«{maxlength}»#« and »cy«UC»#« then jumps to the resulting label
returned in »cy«{variable}»#« by calling »%t«GotoLabel»#«.
This command allows you to "ask" questions and execute
portions of the script based on the answers given. See the
»%t«GetString»#« and »%t«GotoLabel»#« commands for information on these
specific portions of the »%t«AnswerQuestion»#« command.
.pg
Using »%t«DO»#«'s debug facility, we'll ask you to branch to a specific
label of your choice. The command will be displayed in reverse video
before it is executed. Press »bo«<enter>»#« to execute the command.
.pg
First we'll use the »%t«/SET»#« command to set the »cy«{default}»#«
|/SET Default :OOPS!
Then issue the »%t«/ASK»#« command
(Notice that you can use colors in your prompt.)
/REPEAT
|/ASK Label Default " Enter '»ye«One»#«','Two' or 'Three': " "" UC
:One
:Two
:Three
.re
»ye«You entered one of the three choices.»#« It was also placed in
the text variable "Label". We'll expand it in this display block.
First, here's the display line we'll use:
| You entered: »ma«%Label»#«
As you can see, you can control script execution using the
»%t«/ASK»#« command and later use the variable.
/GOTO ASK2
:OOPS!
.re
»ye«You didn't enter one of the selections.»#« You entered: "»ma«%Label»#«"
or just hit the »ma«<Enter>»#« key so »%t«DO»#« branched to the
default label »cy«:OOPS!»#«
:ASK2
/ENDEXEC CLEAR